package com.shopping_assistant.view;

import com.shopping_assistant.model.Offer;
import com.shopping_assistant.model.ShopController;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class OfferView extends Activity {
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.offer_details_view);
		
		Bundle bundle = getIntent().getExtras();
		Offer offer = ShopController.getInstance().findOfferByID(bundle.getInt("offerid"));
		
		TextView offerTitle = (TextView) findViewById(R.id.offerTitle);
        offerTitle.setText(offer.getTitle());
        
        TextView offerOfferPrice = (TextView)findViewById(R.id.offerOfferPrice);
        offerOfferPrice.setText(offer.getOfferPrice() + "");
        
        TextView offerNormalPrice = (TextView)findViewById(R.id.offerNormalPrice);
        offerNormalPrice.setText(offer.getNormalPrice() + "");
        
        TextView offerDuration = (TextView)findViewById(R.id.offerDuration);
        offerDuration.setText(offer.getDuration());
        
        TextView offerProvider = (TextView)findViewById(R.id.offerProvider);
        offerProvider.setText(offer.getOfferProvider().getName());
        
        TextView offerTotalViews = (TextView)findViewById(R.id.offerTotalViews);
        offerTotalViews.setText(offer.getTotalViews() + "");
        
       
	}
	
}
